<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="姓名" id="name">
<input type="text" placeholder="工资" id="sal">
<input type="text" placeholder="工作" id="job">
<input type="button" value="添加" onclick="f()">
<table border="1">
    <tr>
        <td>姓名</td>
        <td>工资</td>
        <td>工作</td>
    </tr>
</table>
<script>
    let name = document.querySelector("#name");
    let sal = document.querySelector("#sal");
    let job = document.querySelector("#job");
    let table = document.querySelector("table");
    function f() {
        let tr = document.createElement("tr");
        let td1 = document.createElement("td");
        let td2 = document.createElement("td");
        let td3 = document.createElement("td");
        td1.innerText = name.value;
        td2.innerText = sal.value;
        td3.innerText = job.value;
        tr.append(td1, td2, td3);
        table.append(tr);
    }
</script>
</body>
</html>